@import '../../styles/default.less';
@import '../../styles//theme/base.less';

.radio {
  .radio-wrapper {
    display: inline-block;
    box-sizing: border-box;
    width: 24px;
    height: 24px;
    text-align: center;
    border-radius: 50%;
    transform: translateY(-4px);
    &:hover {
      background-color: @color-gray-2;
      cursor: pointer;
    }
    input[type='radio'] {
      position: relative;
      display: inline-block;
      box-sizing: border-box;
      width: 14px;
      height: 14px;
      margin: 0;
      padding: 0;
      background-color: #fff;
      border: 2px solid #e5e6eb;
      border-radius: 50%;
      transform: translateY(4.5px);
      appearance: none;
      user-select: none;
      &:hover {
        cursor: pointer;
      }
    }
  }

  .radio-text {
    margin-left: 4px;
    color: @color-gray-8;
    font-size: 14px;
    vertical-align: 2px;
  }
}

.checked {
  .radio-wrapper {
    input[type='radio'] {
      border: 0;
      &::before {
        display: block;
        width: 14px;
        height: 14px;
        background-color: @color-primary-6;
        border-radius: 50%;
        content: '';
      }
      &::after {
        display: block;
        width: 5px;
        height: 5px;
        background-color: #fff;
        border-radius: 50%;
        transform: translate(4.8px, -9.5px);
        content: '';
      }
    }
  }
}

.disabled {
  &:hover {
    cursor: not-allowed;
  }
  .radio-wrapper {
    &:hover {
      background-color: transparent;
      cursor: not-allowed;
    }
    input[type='radio'] {
      &::before {
        background-color: @color-gray-5;
      }
      &::after {
        border-color: @color-gray-6;
      }
      &:hover {
        cursor: not-allowed;
      }
    }
  }
  .radio-text {
    color: @color-gray-5;
    &:hover {
      cursor: not-allowed;
    }
  }
}

.horizontal {
  display: flex;
  flex-wrap: wrap;
}

.vertical {
  display: flex;
  flex-direction: column;
}

.button-radio {
  display: inline-block;
  padding: 2px 5px 4px 5px;
  background-color: @color-gray-2;
  border-radius: 2px;
}
